﻿<div id="insertFlight">
    <h2>New Flight
    </h2>
    <div>
        <label>Flight Number:</label>
    </div>
    <div>
        <input type="text" data-bind="value: flightNumber" />
    </div>
    <div>
        <label>Depart airport:</label>
    </div>
    <div>
        <select data-bind="options: destinations(), value: departAirport, optionsCaption: 'Choose...'">
            <option data-bind="text: $data, attr: { value: $data }"></option>
        </select>
    </div>
    <div>
        <label>Arrival airport:</label>
    </div>
    <div>
        <select data-bind="options: destinations(), value: arrivalAirport, optionsCaption: 'Choose...'">
            <option data-bind="text: $data, attr: { value: $data }"></option>
        </select>
    </div>
    <div>
        <label>Departure Date:</label>
    </div>
    <div>
        <input type="date" data-bind="value: departureDate" />
    </div>
    <div>
        <label>Arrival Date:</label>
    </div>
    <div>
        <input type="date" data-bind="value: arrivalDate" />
    </div>
    <div>
        <input type="button" class="actionButton" value="Insert" data-bind="click: save" />
    </div>
    <div>
        <span data-bind="visible: isFailed()">Failed to add flight</span>
    </div>
</div>
